create external table jms_dwd.dwd_s01_whole_operations_basic_mid_dt (
  waybill_no                                string        comment '运单号',
  network_code                              string        comment '网点编码',
  network_type                              tinyint       comment '网点类型 ; 1.加盟商,2.转运中心,3.集散点,4.普通网点,5.代理区,6.总部,0.其他',
  all_cnt                                   smallint      comment '网点总操作次数',
  network_later_scantime                    timestamp     comment '网点最后一次扫描时间',
  network_early_scantime                    timestamp     comment '网点最早一次扫描时间',
  network_later_scantype                    string        comment '网点最后一次扫描类型',
  network_early_scantype                    string        comment '网点最早一次扫描类型',

  actual_taking_scantime                    timestamp     comment '网点实际揽收时间(揽收入仓取最早)',
  actual_taking_weight                      decimal(10,2) comment '网点实际揽收重量(揽收入仓取最早)',
  actual_taking_scantype                    string        comment '网点实际揽收类型(揽收入仓取最早)',
  actual_taking_scanuser                    string        comment '网点实际揽收扫描员(揽收入仓取最早)',

  taking_later_scantime                     timestamp     comment '网点最晚揽收时间',
  taking_early_scantime                     timestamp     comment '网点最早揽收时间',
  taking_early_weight                       decimal(10,2) comment '运单在该网点揽收最早重量',
  taking_early_scanuser                     string        comment '运单在该网点揽收最早扫描员',

  warehousing_later_scantime                timestamp     comment '网点最晚入仓时间',
  warehousing_early_scantime                timestamp     comment '网点最早入仓时间',
  warehousing_early_weight                  decimal(10,2) comment '网点最早入仓重量',
  warehousing_early_scanuser                string        comment '网点最早入仓扫描员',


  bagging_early_scantime                    timestamp     comment '网点最早建包时间',
  bagging_later_scantime                    timestamp     comment '网点最晚建包时间',
  bagging_later_package_code                string        comment '网点最晚建包包号',

  unloading_later_scantime                  timestamp     comment '网点最晚卸车时间',
  unloading_early_scantime                  timestamp     comment '网点最早卸车时间',
  unloading_early_weight                    decimal(10,2) comment '网点最早卸车重量',

  arrival_later_scantime                    timestamp     comment '网点最晚到件时间',
  arrival_early_scantime                    timestamp     comment '网点最早到件时间',
  arrival_early_weight                      decimal(10,2) comment '网点最早到件重量',
  arrival_early_scanuser                    string        comment '网点最早到件扫描员',

  unloading_arrival_shipment_no             string        comment '网点最早卸车到件任务号',
  unloading_arrival_planned_departure_time  timestamp     comment '网点卸车到件规划发车时间',
  unloading_arrival_planned_arrival_time    timestamp     comment '网点卸车到件规划到车时间',
  unloading_arrival_actual_departure_time   timestamp     comment '网点卸车到件实际发车时间',
  unloading_arrival_actual_arrival_time     timestamp     comment '网点卸车到件实际到车时间',
  unloading_arrival_previous_network_code   string        comment '网点卸车到件上一站网点编码',
  unloading_arrival_previous_network_type   tinyint       comment '网点卸车到件上一站网点类型',

  loading_early_scantime                    timestamp     comment '网点最早装车扫描时间',
  loading_later_scantime                    timestamp     comment '网点最晚装车扫描时间',
  loading_later_weight                      decimal(10,2) comment '网点最晚装车重量',

  send_early_scantime                       timestamp     comment '网点最早发件扫描时间',
  send_later_scantime                       timestamp     comment '网点最晚发件扫描时间',
  send_later_weight                         decimal(10,2) comment '网点最晚发件重量',
  send_later_scanuser                       string        comment '网点最晚发件扫描员',

  loading_send_shipment_no                  string        comment '网点最晚装车发件任务号',
  loading_send_planned_departure_time       timestamp     comment '网点装车发件规划发车时间',
  loading_send_planned_arrival_time         timestamp     comment '网点装车发件规划到车时间',
  loading_send_actual_departure_time        timestamp     comment '网点装车发件实际发车时间',
  loading_send_actual_arrival_time          timestamp     comment '网点装车发件实际到车时间',
  loading_send_next_network_code            string        comment '网点最晚装车发件下一站网点编码',
  loading_send_next_network_type            tinyint       comment '网点最晚装车发件下一站网点类型',

  deliver_early_scantime                    timestamp     comment '网点最早派件扫描时间',
  deliver_later_scantime                    timestamp     comment '网点最晚派件扫描时间',
  deliver_later_weight                      decimal(10,2) comment '网点最晚派件重量',
  deliver_later_scanuser                    string        comment '网点最晚派件扫描员',

  sign_later_scantime                       timestamp     comment '网点最晚签收扫描时间',
  sign_early_scantime                       timestamp     comment '网点最早签收扫描时间',
  sign_early_weight                         decimal(10,2) comment '网点最早签收重量',
  sign_early_scanuser                       string        comment '网点最早签收扫描员',

  actual_sign_scantime                      timestamp     comment '网点实际签收时间(签收出库取最早)',
  actual_sign_weight                        decimal(10,2) comment '网点实际签收重量(签收出库取最早)',
  actual_sign_scantype                      string        comment '网点实际签收类型(签收出库取最早)',
  actual_sign_scanuser                      string        comment '网点实际签收扫描员(签收出库取最早)',

  aging_sign_scantime                       timestamp     comment '网点时效签收时间(签收,出库,入库,代理点收入取最早)',
  aging_sign_weight                         decimal(10,2) comment '网点时效签收重量(签收,出库,入库,代理点收入取最早)',
  aging_sign_scantype                       string        comment '网点时效签收类型(签收,出库,入库,代理点收入取最早)',
  aging_sign_scanuser                       string        comment '网点时效签收扫描员(签收,出库,入库,代理点收入取最早)',

  unbagging_early_scantime                  timestamp     comment '网点最早拆包时间',
  unbagging_later_scantime                  timestamp     comment '网点最晚拆包时间',
  unbagging_later_package_code              string        comment '网点最晚拆包包号'

)
comment '运单网点维度中间表，统计7天'
partitioned by (dt string comment '更新/创建日期(yyyy-mm-dd)')
stored as parquet
location '/dw/hive/jms_dwd.db/external/dwd_s01_whole_operations_basic_mid_dt'
tblproperties (
        'parquet.column.index.access' = 'true'
);